<template>
    <div>
           <li><nuxt-link to='/users/child'>child</nuxt-link></li>
           <li><nuxt-link to='/parent/child2'>child2</nuxt-link></li>
           <nuxt-child keep-alive/>
    </div>
</template>

<script>
export default {
   middleware: 'auth', 
   transition: 'test', 
   name:'users',
   middleware(){
        console.log("页面级别的middleware")
    },
    validate(e){
       console.log('validate');
       return e
   },
   asyncData({$axios}){
     //    已经加入代理
         $axios.$get("/api/userPost").then(res=>{
              console.log(res);
         })
         console.log('asyncData')
   },
  
   fetch({store}){
        store.dispatch('todos/nuxtServerInit','nuxtServerInit')
   },
 
   beforeCreate(){
        console.log('beforeCreate')
   },
    data(){
        console.log('data')
   },
   created(){
       console.log('create')
   },
   head(){
        console.log('head')
   },
   mounted(){
        console.log('mounted')
   },
    
}
</script>

